/**
 * 描述: 推送消息路由
 * 作者: wz
 * 日期: 2024-01-30
*/

const express = require('express');
const router = express.Router();
const { body } = require('express-validator');
const service = require('../services/wordService');


// 推送消息路由
router.post('/getWordList', service.getWordList);

// 编辑设备校验
const addWordVaildator = [
    body('user_id').isInt().withMessage('用户id类型错误'),
    body('book_id').isInt().withMessage('词汇包id类型错误'),
    body('words').isString().withMessage('单词类型错误'),
  ]
// 添加学习单词
router.post('/addStudyWord', addWordVaildator, service.addStudyWord);

// 获得单词信息
router.post('/getStudyWordList', service.getStudyWordList);

// 编辑设备校验
const addStudyLogVaildator = [
  body('study_id').isInt().withMessage('用户id类型错误'),
]
// 添加学习单词
router.post('/addStudyLog', addStudyLogVaildator, service.addStudyLog);
router.post('/getStudyLogList', service.getStudyLogList);

// 获得测试信息
router.post('/getExamList', service.getExamList);

module.exports = router;

